import * as BL from 'babylon-lib/index';
import { DefaultStage } from "./stage/default-stage";
// import { AppUI } from './app-ui';
import * as Data from './data/data';
import { RenderOrder } from 'babylon-lib/misc/render-order';


export default class AppContainer extends BL.BabylonContainer {

    protected options(): BL.IContainerOptions {
        return {
            adaptToDeviceRatio: true,
            engineOptions: {
                limitDeviceRatio: 1.5,
                preserveDrawingBuffer: true,
            },
            showPerformance: !Data.isProduction.value,
            useRightHand: true,
        };
    }
    protected loadingUI(): HTMLElement | null {
        return document.getElementById('loading-page');
    }

    protected initializeStages(engine: BL.Engine, canvas: HTMLCanvasElement, bufferLoader: BL.BufferLoad): Array<BL.Stage> {
        RenderOrder.initialize(...Object.values(Data.orders));
        const stage = new DefaultStage(engine, canvas, bufferLoader);
        return [stage];
    }

    protected renderUI(): void {
        // const appUi = new AppUI(this.engine, this.stageManager.stages);
    }

}